//
//  NRWBuyCarFilterTopView.m
//  NRWMall
//
//  Created by 张记 on 2018/6/7.
//  Copyright © 2018年 com.anpxd. All rights reserved.
//

#import "NRWBuyCarFilterTopView.h"

@interface NRWBuyCarFilterTopView ()
@property (weak, nonatomic) IBOutlet UIButton *sortBtn;
@property (strong, nonatomic) IBOutlet UIButton *carAuthStateBtn;

@end

@implementation NRWBuyCarFilterTopView

- (void)setIsCarAuthState:(BOOL)isCarAuthState {
    
    _isCarAuthState = isCarAuthState;
    
    self.carAuthStateBtn.selected = isCarAuthState;
    
    if (isCarAuthState) {
        [self.carAuthStateBtn setImage:[UIImage imageNamed:@"login_duihao_s"] forState:UIControlStateNormal];
    }else{
        [self.carAuthStateBtn setImage:[UIImage imageNamed:@"login_duihao_n"] forState:UIControlStateNormal];
    }
}


- (IBAction)newRunwayAuthenticate:(UIButton *)sender {
    
    sender.selected = !sender.selected;
    if (sender.selected == YES) {
        [sender setImage:[UIImage imageNamed:@"login_duihao_s"] forState:UIControlStateNormal];
    }else{
        [sender setImage:[UIImage imageNamed:@"login_duihao_n"] forState:UIControlStateNormal];
    }
    
    self.topMenuClickBlock(FilterType_Authenticate, sender.selected);
}

-(void)setSortingStr:(NSString *)sortingStr{
    _sortingStr = sortingStr;
    [self.sortBtn setTitle:sortingStr forState:UIControlStateNormal];
    [self.sortBtn setTitleColor:mainColor() forState:UIControlStateNormal];

}

- (IBAction)stortingNotmal:(UIButton *)sender {
    sender.selected = !sender.selected;
    self.topMenuClickBlock(FilterType_sortingNormal, sender.selected);
     [sender setImage:[UIImage imageNamed:@"buy_car_down"] forState:UIControlStateNormal];

}
- (IBAction)carBrands:(UIButton *)sender {
    sender.selected = !sender.selected;
    self.topMenuClickBlock(FilterType_brands, sender.selected);
    [sender setImage:[UIImage imageNamed:@"buy_car_down"] forState:UIControlStateNormal];

}

- (IBAction)carPrice:(UIButton *)sender {
    sender.selected = !sender.selected;
    self.topMenuClickBlock(FilterType_price, sender.selected);
    [sender setImage:[UIImage imageNamed:@"buy_car_down"] forState:UIControlStateNormal];

}
- (IBAction)carCity:(UIButton *)sender {
    sender.selected = !sender.selected;
    self.topMenuClickBlock(FilterType_city, sender.selected);
    [sender setImage:[UIImage imageNamed:@"buy_car_down"] forState:UIControlStateNormal];

}
- (IBAction)buyCarFilter:(UIButton *)sender {
    sender.selected = !sender.selected;
    self.topMenuClickBlock(FilterType_filter, sender.selected);
    [sender setImage:[UIImage imageNamed:@"buy_car_down"] forState:UIControlStateNormal];

}

@end
